<?
$JO[ "MyTask"		] = JO( array( "EN" => "My Task",		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhiệm Vụ Của Tôi"		) );
$JO[ "Key"			] = JO( array( "EN" => "Key",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Mã Số"		) );
$JO[ "Subject"		] = JO( array( "EN" => "Subject",		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Tựa Đề"		) );
$JO[ "Priority"		] = JO( array( "EN" => "Priority",		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Ưu Tiên"		) );
$JO[ "Period"		] = JO( array( "EN" => "Period",		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Thời Hạn"		) );
$JO[ "Today"		] = JO( array( "EN" => "Today",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Today"		) );
$JO[ "PublicTask"	] = JO( array( "EN" => "Public Task",	"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhiệm Vụ Chung"		) );
$JO[ "UpdateTask"	] = JO( array( "EN" => "Update a Task", "KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Câp Nhật Nhiệm Vụ"		) );
$JO[ "InsertTask"	] = JO( array( "EN" => "Insert a Task", "KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhập Nhiệm Vụ"		) );
$JO[ "Parent"		] = JO( array( "EN" => "Parent", 		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Tác Vụ Chủ"		) );
$JO[ "Operator"		] = JO( array( "EN" => "Operator",		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Người Thực Hiện"		) );
$JO[ "Link"			] = JO( array( "EN" => "Link", 			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Đường Dẫn"		) );
$JO[ "Content"		] = JO( array( "EN" => "Content", 		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nội Dung"		) );
$JO[ "Type"			] = JO( array( "EN" => "Type", 			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Loại"		) );
$JO[ "Private"		] = JO( array( "EN" => "Private", 		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Riêng"		) );
$JO[ "Public"		] = JO( array( "EN" => "Public", 		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Chung"		) );

?>
<div class="JO_left">



	<!-- My Task -->

		<div class="JO_bar_720">

			<h1><?=$JO[ "MyTask" ] ?></h1>

			<div>

				<table>

					<tr>
						<th style="width: 49px;"> <?=$JO[ "Key" ] ?>		</th>
						<th						> <?=$JO[ "Subject" ] ?>	</th>
						<th style="width: 49px;"> <?=$JO[ "Priority" ] ?>	</th>
						<th style="width: 109px;"><?=$JO[ "Period" ] ?>		</th>
						<th style="width: 49px;"> <?=$JO[ "Today" ] ?>		</th>
					</tr>



					<?

						$query = "
							SELECT		*,
										( SELECT `name` FROM `account` WHERE `key` = `manager`																											) AS `manager FKF`,
										( SELECT `name` FROM `account` WHERE `key` = `operator`																											) AS `operator FKF`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "'								) AS `today`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "' AND `account` = `operator`	) AS `today operator`,
										`JC_sort_task`( `key`																																			) AS `order`
							FROM		`task`
							WHERE		`delete` IS NULL
							AND			( `operator` = '" . $_SESSION[ "JO_account_key" ] . "' OR `manager` = '" . $_SESSION[ "JO_account_key" ] . "' )
							AND			( `progress` != 'has been finished' OR ( `progress` = 'has been finished' AND SUBSTR( `update`, 1, 10 ) = '" . date( "Y-m-d" ). "'  ) )
							ORDER BY	`order` DESC
						";

						$recordSet = JO_query( $query );

						if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {

					?>

						<!-- List -->

							<tr>

								<td
									id		= "SO_task_my_key_<?= $record[ "key" ] ?>"
									class	= "JO_right"
									style	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "border-bottom: 1px solid #FFFFFF;" : "" ?>"
								><?= number_format( $record[ "key" ] ) ?></td>

								<td>

									<? for( $i = 0; $i < substr_count( $record[ "order" ], ";" ) - 1; $i ++ ) echo "&nbsp;"; ?>

									<a
										href	= "#this"
										<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "style='color: #000000;'" : "" ?>
										onclick	= "

													JO_display( 'SO_task_my_data_<?=	$record[ "key" ] ?>' );
											try {	JO_display( 'SO_task_my_content_<?=	$record[ "key" ] ?>' ); } catch( exception ) { }
											try {	JO_display( 'SO_task_my_link_<?=	$record[ "key" ] ?>' ); } catch( exception ) { }
											try {	JO_display( 'SO_task_my_report_<?=	$record[ "key" ] ?>' ); } catch( exception ) { }
													JO_display( 'SO_task_my_insert_<?=	$record[ "key" ] ?>' );

											if( this.style.color == '' ) {

												this.style.color = '#000000';
												document.getElementById( 'SO_task_my_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #FFFFFF';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_my_<?= $record[ "key" ] ?>&JO_session_value=on';

											} else {

												this.style.color = '';
												document.getElementById( 'SO_task_my_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #D7D7D7';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_my_<?= $record[ "key" ] ?>&JO_session_value=';

											}

										"
									><?= $record[ "subject" ] ?></a>

								</td>

								<td class="JO_right"><?= number_format( $record[ "priority" ] ) ?></td>

								<td><?= substr( $record[ "period" ], 0, 16 ) ?></td>

								<td class="JO_right">
									<?= number_format( $record[ "today operator"	] ) ?> <span class="JO_gray_40">/</span>
									<?= number_format( $record[ "today"				] ) ?>
								</td>

							</tr>



						<!-- Data -->

							<tr
								id		= "SO_task_my_data_<?= $record[ "key" ] ?>"
								class	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
							>

								<td style="border-bottom: 1px solid #FFFFFF;"></td>

								<td>
									<?= $record[ "manager FKF"	] ?> <span class="JO_gray_40">→</span>
									<?= $record[ "operator FKF"	] ?>
								</td>

								<td	class="JO_right"><?= $record[ "parent" ] ? number_format( $record[ "parent" ] ) : "" ?></td>

								<td><?= $record[ "progress"	] ?></td>
								<td><?= $record[ "type"		] ?></td>

							</tr>



						<!-- Content -->

							<? if( $record[ "content" ] ) { ?>

								<tr
									id		= "SO_task_my_content_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4"><?= str_replace( "\r\n", "<br />", $record[ "content" ] ) ?></td>

								</tr>

							<? } ?>



						<!-- link -->

							<? if( $record[ "link" ] ) { ?>

								<tr
									id		= "SO_task_my_link_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4">

										<? foreach( explode( "\r\n", $record[ "link" ] ) as $key => $value ) { ?>

											<a href="<?= $value ?>" title="<?= $value ?>" target="_blank"><?= strlen( $value ) <= 64 ? $value : substr( $value, 0, 64 ) . "..."  ?></a><br />

										<? } ?>

									</td>

								</tr>

							<? } ?>



						<!-- Report -->

							<?

								$query = "
									SELECT		*,
												( SELECT `name` FROM `account` WHERE `key` = `account` ) AS `account FKF`
									FROM		`report`
									WHERE		`delete` IS NULL
									AND			`task` = '" . $record[ "key" ] . "'
									ORDER BY	`insert` DESC
								";

								$recordSet_report = JO_query( $query );

								if( $recordSet_report -> num_rows ) {

							?>

								<tr
									id		= "SO_task_my_report_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4" style="padding: 0px;">

										<table style="margin: 0px 0px -1px 0px; width: 100%;">

											<? while( $record_report = $recordSet_report -> fetch_array( ) ) { ?>

												<tr>

													<td colspan="2"><?= str_replace( "\r\n", "<br />", $record_report[ "content" ] ) ?></td>

													<td style="width: 113px;"><?= $record_report[ "account FKF" ] ?></td>

													<td style="width: 89px;"><?= substr( $record_report[ "insert" ], 0, 16 ) ?></td>

												</tr>

											<? } ?>

										</table>

									</td>

								</tr>

							<? } ?>



						<!-- From -->

							<form
								action	= "JO_71_SO/SO_05_execution.php"
								target	= "JO_integration_asynchronous"
								method	= "post"
							>

								<input type="hidden" name="SO_task_key"	value="<?= $record[ "key" ] ?>"	/>
								<input type="hidden" name="SO_query"	value="task_report"				/>

								<tr
									id		= "SO_task_my_insert_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_my_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td></td>

									<td colspan="3">

										<textarea
											name	= "SO_task_report"
											style	= "width: 535px;"
											onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px'";"
										></textarea>

									</td>

									<td style="vertical-align: bottom;">

										<input
											type	= "submit"
											value	= "Insert"
											class	= "JO_button"
											style	= "width: 48px;"
										/>

									</td>

								</tr>

							</form>



					<? } ?>



				</table>

			</div>

		</div>



	<!-- Public Task -->

		<div class="JO_bar_720">

			<h1><?=$JO[ "PublicTask" ]?></h1>

			<div>

				<table>

					<tr>
						<th style="width: 49px;"><?=$JO[ "Key" ]?>		</th>
						<th						><?=$JO[ "Subject" ]?>	</th>
						<th style="width: 49px;"><?=$JO[ "Priority" ]?>	</th>
						<th style="width: 109px;"><?=$JO[ "Period" ]?>	</th>
						<th style="width: 49px;"><?=$JO[ "Today" ]?>	</th>
					</tr>



					<?

						$query = "
							SELECT		*,
										( SELECT `name` FROM `account` WHERE `key` = `manager`																											) AS `manager FKF`,
										( SELECT `name` FROM `account` WHERE `key` = `operator`																											) AS `operator FKF`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "'								) AS `today`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "' AND `account` = `operator`	) AS `today operator`,
										`JC_sort_task`( `key`																																			) AS `order`
							FROM		`task`
							WHERE		`delete` IS NULL
							AND			`operator`	!= '" . $_SESSION[ "JO_account_key" ] . "'
							AND			`manager`	!= '" . $_SESSION[ "JO_account_key" ] . "'
							AND			`type` = 'public'
							AND			( `progress` != 'has been finished' OR ( `progress` = 'has been finished' AND SUBSTR( `update`, 1, 10 ) = '" . date( "Y-m-d" ). "'  ) )
							ORDER BY	`order` DESC
						";

						$recordSet = JO_query( $query );

						if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {

					?>

						<!-- List -->

							<tr>

								<td
									id		= "SO_task_public_key_<?= $record[ "key" ] ?>"
									class	= "JO_right"
									style	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "border-bottom: 1px solid #FFFFFF;" : "" ?>"
								><?= number_format( $record[ "key" ] ) ?></td>

								<td>

									<? for( $i = 0; $i < substr_count( $record[ "order" ], ";" ) - 1; $i ++ ) echo "&nbsp;"; ?>

									<a
										href	= "#this"
										<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "style='color: #000000;'" : "" ?>
										onclick	= "

													JO_display( 'SO_task_public_data_<?=	$record[ "key" ] ?>' );
											try {	JO_display( 'SO_task_public_content_<?=	$record[ "key" ] ?>' ); } catch( exception ) { }
											try {	JO_display( 'SO_task_public_link_<?=		$record[ "key" ] ?>' ); } catch( exception ) { }
											try {	JO_display( 'SO_task_public_report_<?=	$record[ "key" ] ?>' ); } catch( exception ) { }
													JO_display( 'SO_task_public_insert_<?=	$record[ "key" ] ?>' );

											if( this.style.color == '' ) {

												this.style.color = '#000000';
												document.getElementById( 'SO_task_public_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #FFFFFF';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_public_<?= $record[ "key" ] ?>&JO_session_value=on';

											} else {

												this.style.color = '';
												document.getElementById( 'SO_task_public_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #D7D7D7';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_public_<?= $record[ "key" ] ?>&JO_session_value=';

											}

										"
									><?= $record[ "subject" ] ?></a>

								</td>

								<td class="JO_right"><?= number_format( $record[ "priority" ] ) ?></td>

								<td><?= substr( $record[ "period" ], 0, 16 ) ?></td>

								<td class="JO_right">
									<?= number_format( $record[ "today operator"	] ) ?> <span class="JO_gray_40">/</span>
									<?= number_format( $record[ "today"				] ) ?>
								</td>

							</tr>



						<!-- Data -->

							<tr
								id		= "SO_task_public_data_<?= $record[ "key" ] ?>"
								class	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
							>

								<td style="border-bottom: 1px solid #FFFFFF;"></td>

								<td>
									<?= $record[ "manager FKF"	] ?> <span class="JO_gray_40">→</span>
									<?= $record[ "operator FKF"	] ?>
								</td>

								<td	class="JO_right"><?= $record[ "parent" ] ? number_format( $record[ "parent" ] ) : "" ?></td>

								<td><?= $record[ "progress"	] ?></td>
								<td><?= $record[ "type"		] ?></td>

							</tr>



						<!-- Content -->

							<? if( $record[ "content" ] ) { ?>

								<tr
									id		= "SO_task_public_content_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4"><?= str_replace( "\r\n", "<br />", $record[ "content" ] ) ?></td>

								</tr>

							<? } ?>



						<!-- link -->

							<? if( $record[ "link" ] ) { ?>

								<tr
									id		= "SO_task_public_link_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4">

										<? foreach( explode( "\r\n", $record[ "link" ] ) as $key => $value ) { ?>

											<a href="<?= $value ?>" title="<?= $value ?>" target="_blank"><?= strlen( $value ) <= 64 ? $value : substr( $value, 0, 64 ) . "..."  ?></a><br />

										<? } ?>

									</td>

								</tr>

							<? } ?>



						<!-- Report -->

							<?

								$query = "
									SELECT		*,
												( SELECT `name` FROM `account` WHERE `key` = `account` ) AS `account FKF`
									FROM		`report`
									WHERE		`delete` IS NULL
									AND			`task` = '" . $record[ "key" ] . "'
									ORDER BY	`insert` DESC
								";

								$recordSet_report = JO_query( $query );

								if( $recordSet_report -> num_rows ) {

							?>

								<tr
									id		= "SO_task_public_report_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="4" style="padding: 0px;">

										<table style="margin: 0px 0px -1px 0px; width: 100%;">

											<? while( $record_report = $recordSet_report -> fetch_array( ) ) { ?>

												<tr>

													<td colspan="2"><?= str_replace( "\r\n", "<br />", $record_report[ "content" ] ) ?></td>

													<td style="width: 113px;"><?= $record_report[ "account FKF" ] ?></td>

													<td style="width: 89px;"><?= substr( $record_report[ "insert" ], 0, 16 ) ?></td>

												</tr>

											<? } ?>

										</table>

									</td>

								</tr>

							<? } ?>



						<!-- From -->

							<form
								action	= "JO_71_SO/SO_05_execution.php"
								target	= "JO_integration_asynchronous"
								method	= "post"
							>

								<input type="hidden" name="SO_task_key"	value="<?= $record[ "key" ] ?>"	/>
								<input type="hidden" name="SO_query"	value="task_report"				/>

								<tr
									id		= "SO_task_public_insert_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_public_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td></td>

									<td colspan="3">

										<textarea
											name	= "SO_task_report"
											style	= "width: 535px;"
											onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px';"
										></textarea>

									</td>

									<td style="vertical-align: bottom;">

										<input
											type	= "submit"
											value	= "Insert"
											class	= "JO_button"
											style	= "width: 48px;"
										/>

									</td>

								</tr>

							</form>



					<? } ?>



				</table>

			</div>

		</div>



	<!-- Update a Task -->

		<div class="JO_bar_720">

			<h1><?=$JO[ "UpdateTask" ]?></h1>

			<div>

				<table>

					<tr>
						<th style="width: 49px;"><?=$JO[ "Key" ]?>		</th>
						<th						><?=$JO[ "Subject" ]?>	</th>
						<th style="width: 49px;"><?=$JO[ "Priority" ]?>	</th>
						<th style="width: 109px;"><?=$JO[ "Period" ]?>	</th>
						<th style="width: 49px;"><?=$JO[ "Today" ]?>	</th>
					</tr>



					<?

						$query = "
							SELECT		*,
										( SELECT `name` FROM `account` WHERE `key` = `manager`																											) AS `manager FKF`,
										( SELECT `name` FROM `account` WHERE `key` = `operator`																											) AS `operator FKF`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "'								) AS `today`,
										( SELECT COUNT( `key` ) FROM `report` WHERE `report`.`task` = `task`.`key` AND SUBSTR( `insert`, 1, 10 ) = '" . date( "Y-m-d" ). "' AND `account` = `operator`	) AS `today operator`,
										`JC_sort_task`( `key`																																			) AS `order`
							FROM		`task`
							WHERE		`delete` IS NULL
							AND			`manager`	= '" . $_SESSION[ "JO_account_key" ] . "'
							AND			( `progress` != 'has been finished' OR ( `progress` = 'has been finished' AND SUBSTR( `update`, 1, 10 ) = '" . date( "Y-m-d" ). "'  ) )
							ORDER BY	`order` DESC
						";

						$recordSet = JO_query( $query );

						if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {

					?>



						<!-- List -->

							<tr>

								<td
									id		= "SO_task_update_key_<?= $record[ "key" ] ?>"
									class	= "JO_right"
									style	= "<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "border-bottom: 1px solid #FFFFFF;" : "" ?>"
								><?= number_format( $record[ "key" ] ) ?></td>

								<td>

									<? for( $i = 0; $i < substr_count( $record[ "order" ], ";" ) - 1; $i ++ ) echo "&nbsp;"; ?>

									<a
										href	= "#this"
										<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "style='color: #000000;'" : "" ?>
										onclick	= "

											JO_display( 'SO_task_update_subject_<?=	$record[ "key" ] ?>' );
											JO_display( 'SO_task_update_data_<?=	$record[ "key" ] ?>' );
											JO_display( 'SO_task_update_content_<?=	$record[ "key" ] ?>' );
											JO_display( 'SO_task_update_link_<?=	$record[ "key" ] ?>' );

											if( this.style.color == '' ) {

												this.style.color = '#000000';
												document.getElementById( 'SO_task_update_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #FFFFFF';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_update_<?= $record[ "key" ] ?>&JO_session_value=on';

											} else {

												this.style.color = '';
												document.getElementById( 'SO_task_update_key_<?= $record[ "key" ] ?>' ).style.borderBottom = '1px solid #D7D7D7';
												document.getElementById( 'JO_integration_asynchronous' ).src='JO_05_execution.php?JO_query=session&JO_session_key=SO_task_update_<?= $record[ "key" ] ?>&JO_session_value=';

											}

										"
									><?= $record[ "subject" ] ?></a>

								</td>

								<td class="JO_right"><?= number_format( $record[ "priority" ] ) ?></td>

								<td><?= substr( $record[ "period" ], 0, 16 ) ?></td>

								<td class="JO_right">
									<?= number_format( $record[ "today operator"	] ) ?> <span class="JO_gray_40">/</span>
									<?= number_format( $record[ "today"				] ) ?>
								</td>

							</tr>



						<form
							action	= "JO_71_SO/SO_05_execution.php"
							target	= "JO_integration_asynchronous"
							method	= "post"
						>

							<input type="hidden" name="SO_task_key"	value="<?= $record[ "key" ] ?>"	/>
							<input type="hidden" name="SO_query"	value="task_update"				/>



							<!-- Subject -->

								<tr
									id		= "SO_task_update_subject_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td>

										<input
											type	= "text"
											name	= "SO_task_subject"
											value	= "<?= $record[ "subject" ] ?>"
											style	= "width: 351px;"
										/>

									</td>

									<td>

										<select
											name	= "SO_task_priority"
											class	= "JO_right"
											style	= "width: 48px;"
										>

											<? for( $i = 127; $i >= -128; $i -- ) { ?>

												<option class="JO_right" <?= $record[ "priority" ] == $i ? "selected" : "" ?>><?= $i ?></option>

											<? } ?>

										</select>

									</td>

									<td>

										<input
											type	= "text"
											name	= "SO_task_period"
											value	= "<?= $record[ "period" ] ?>"
											style	= "width: 95px;"
										/>

									</td>

									<td></td>

								</tr>



							<!-- Data-->

								<tr
									id		= "SO_task_update_data_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td>

										<select
											name	= "SO_task_operator"
											style	= "width: 160px;"
										>

											<? foreach( SO_organization( 1 ) as $key => $value ) { ?>

												<option value="<?= $key ?>" <?= $record[ "operator" ] == $key ? "selected" : "" ?>><?= $value ?></option>

											<? } ?>

										</select>

										<select
											name	= "SO_task_parent"
											style	= "position: absolute; left:252px; width: 252px;"
										>

											<option></option>

											<?

												$query = "SELECT `key`, `subject` FROM `task`";

												$recordSet_task = JO_query( $query );

												If( $recordSet_task -> num_rows ) while( $record_task = $recordSet_task -> fetch_array( ) ) {

											?>

												<option value="<?= $record_task[ "key" ] ?>" <?= $record[ "parent" ] == $record_task[ "key" ] ? "selected" : "" ?>><?= $record_task[ "key" ] ?>: <?= $record_task[ "subject" ] ?></option>

											<? } ?>

										</select>

									</td>

									<td></td>

									<td>

										<select
											name	= "SO_task_progress"
											style	= "width: 108px;"
										>

											<option <?= $record[ "progress" ] == "will be started"			? "selected" : "" ?>>will be started			</option>
											<option <?= $record[ "progress" ] == "will be finished on time"	? "selected" : "" ?>>will be finished on time	</option>
											<option <?= $record[ "progress" ] == "will be delayed"			? "selected" : "" ?>>will be delayed			</option>
											<option <?= $record[ "progress" ] == "has been done"			? "selected" : "" ?>>has been done				</option>

										</select>

									</td>

									<td>

										<select
											name	= "SO_task_type"
											style	= "width: 48px;"
										>

											<option <?= $record[ "type" ] == "public"	? "selected" : "" ?>>public		</option>
											<option <?= $record[ "type" ] == "private"	? "selected" : "" ?>>private	</option>

										</select>

									</td>

								</tr>



							<!-- Content -->

								<tr
									id		= "SO_task_update_content_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td style="border-bottom: 1px solid #FFFFFF;"></td>

									<td colspan="3">

										<textarea
											name	= "SO_task_content"
											style	= "width: 535px; height: <?= substr_count( $record[ "content" ], "\r\n" ) ? substr_count( $record[ "content" ], "\r\n" ) * 16 : 16 ?>px;"
											onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px'";"
										><?= $record[ "content" ] ?></textarea>

									</td>

									<td></td>

								</tr>



							<!-- link -->

								<tr
									id		= "SO_task_update_link_<?= $record[ "key" ] ?>"
									class	= "<?= $_SESSION[ "SO_task_update_" . $record[ "key" ] ] ? "" : "JO_none" ?>"
								>

									<td></td>

									<td colspan="3">

										<textarea
											name	= "SO_task_link"
											style	= "width: 535px; height: <?= substr_count( $record[ "content" ], "\r\n" ) ? substr_count( $record[ "content" ], "\r\n" ) * 16 : 16 ?>px;"
											onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px';"
										><?= $record[ "link" ] ?></textarea>

									</td>

									<td style="vertical-align: bottom;">

										<input
											type	= "submit"
											value	= "Update"
											class	= "JO_button"
											style	= "padding: 0px 0px 0px 1px; width: 48px;"
										/>

									</td>

								</tr>



						</form>

					<? } ?>



				</table>

			</div>

		</div>



	<!-- Insert a Task -->

		<form
			action	= "JO_71_SO/SO_05_execution.php"
			target	= "JO_integration_asynchronous"
			method	= "post"
			class	= "JO_bar_720"
		>

			<input type="hidden" name="SO_query" value="task_insert" />



			<h1><?=$JO[ "InsertTask" ]  ?></h1>



			<div>

				<table>

					<tr>
						<th style="width: 81px;"><?=$JO[ "Parent" ]  ?></th>
						<td>

							<select name="SO_task_parent" style="width: 584px;">

								<option></option>

								<?

									$query = "SELECT `key`, `subject` FROM `task`";

									$recordSet_task = JO_query( $query );

									If( $recordSet_task -> num_rows ) while( $record_task = $recordSet_task -> fetch_array( ) ) {

								?>

									<option value="<?= $record_task[ "key" ] ?>"><?= $record_task[ "key" ] ?>: <?= $record_task[ "subject" ] ?></option>

								<? } ?>

							</select>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Priority" ]  ?></th>
						<td>

							<select name="SO_task_priority" class="JO_right" style="width: 584px;">

								<? for( $i = 127; $i > -129; $i -- ) { ?>

									<option class="JO_right" <?= $i == 0 ? "selected" : "" ?>><?= $i ?></option>

								<? } ?>

							</select>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Operator" ]  ?></th>
						<td>

							<select name="SO_task_operator" style="width: 584px;">

								<? foreach( SO_organization( 1 ) as $key => $value ) { ?>

									<option value="<?= $key ?>"><?= $value ?></option>

								<? } ?>

							</select>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Type" ]  ?></th>
						<td>

							<select name="SO_task_type" style="width: 584px;">

								<option><?=$JO[ "Public" ] ?>	</option>
								<option><?=$JO[ "Private" ] ?>	</option>

							</select>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Subject" ]  ?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_task_subject"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
								onblur	= "document.getElementById( 'JO_account_query' ).value = 'identifier'; submit( );"
							 />

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Content" ]  ?></th>
						<td>

							<textarea
								name	= "SO_task_content"
								style	= "width: 567px; vertical-align: top;"
								onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px'";"
							></textarea>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Link" ]  ?></th>
						<td>

							<textarea
								name	= "SO_task_link"
								style	= "width: 567px; vertical-align: top;"
								onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px'";"
							></textarea>

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Period" ]  ?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_task_period"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
								onblur	= "document.getElementById( 'JO_account_query' ).value = 'identifier'; submit( );"
							 />

						</td>
					</tr>


					<tr>
						<th style	= "border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF;"></th>
						<td style	= "border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF;">

							<input
								type	= "submit"
								value	= "<?= JO( array(
									"EN" => "Insert a task",
									"KO" => "아티스트",
									"VI" => "Nhập Công Việc",
									) ) ?>"
								class	= "JO_button"
								style	= "width: 584px;"
							/>

						</td>
					</tr>

				</table>

			</div>



		</form>



</div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              